const express = require('express')

const app = express()

app.get('/jsonp', (req, res) => {
  // 获取 jsonp 回调函数名称
  const { callback } = req.query
  res.send(`${callback}(${JSON.stringify({
    code: 100,
    msg: 'JSONP 跨域成功'
  })})`)
})
 

app.listen(80, () => {
  console.log('express server running at http://127.0.0.1')
})